<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板字符串</title>
</head>
<body>
    
</body>

<script>
    //声明方式
    let str = `hello`;
    console.log(str);
    //特性1 能直接识别换行
    let htmlStr = `
        <div>
            <h2>hello world</h2>
        </div>
    `;

    //特性2 变量拼接 在字符串中插入变量，需要${}
    let str1 = `hello`;
    let str2 = `${str1}world`;
    console.log(str2);

    

</script>

</html>